package com.jsp.service;

import java.sql.SQLException;
import java.sql.Timestamp;

import com.jsp.bean.RentcarBean;
import com.jsp.dao.RentcarDao;

public class RentcarService {

	private RentcarBean rentcarBean;
	private RentcarDao rentcarDao;
	
	
	public RentcarBean insert(String apply_name, String openTime,
			String returnTime, String reason, String apply_car,
			String apply_driver, String opinion)throws SQLException{
			
		rentcarBean=new RentcarBean(apply_name, openTime, returnTime, reason, apply_car, apply_driver, opinion);
		rentcarDao=new RentcarDao();
		
				return rentcarDao.insert(rentcarBean);
		
	}
	
	public RentcarBean update(String id, String apply_name, String openTime,
			String returnTime, String reason, String apply_car, String apply_driver,
			String opinion)throws SQLException {
	
		rentcarBean=new RentcarBean(id, apply_name, openTime, returnTime, reason, apply_car, apply_driver, opinion);
		rentcarDao=new RentcarDao();
		
				return rentcarDao.update(rentcarBean);
		
	}
	
	public RentcarBean delete(String id, String apply_name, String openTime,
			String returnTime, String reason, String apply_car, String apply_driver,
			String opinion)throws SQLException{
		rentcarBean=new RentcarBean(id, apply_name, openTime, returnTime, reason, apply_car, apply_driver, opinion);
		rentcarDao=new RentcarDao();
		
		        return rentcarDao.delete(rentcarBean);
	}
	
}
